<!DOCTYPE html>
<html>
<head>
    <style>
        body {
            font-family: 'Arial', sans-serif;
            background-color: #f4f4f9;
            color: #333;
            margin: 0;
            padding: 20px;
        }
        .card {
            background-color: #fff;
            border: 1px solid #ddd;
            border-radius: 8px;
            padding: 15px;
            margin-bottom: 20px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 20px;
        }
        th, td {
            border: 1px solid #ddd;
            padding: 8px;
            text-align: left;
        }
        th {
            background-color: #ECECEC;
            color: #333;
        }
        a {
            color: #3498db;
            text-decoration: none;
        }
        a:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>
    <h1>{{ yesterday_str }}</h1>
    {% for interest, episodes in receiver_data.items() %}
        <div class="card">
            <h2>《{{ interest }}》</h2>
            {% if episodes[0].img_uri %}
            <img src="{{ episodes[0].img_uri }}" alt="{{ interest }}">
            {% endif %}
            <table>
                <tr>
                    <th>Episode</th>
                    <th>Time</th>
                    <th>Author</th>
                    <th>Link</th>
                </tr>
                {% for episode in episodes %}
                    <tr>
                        <td>{{ episode['Episode'] }}</td>
                        <td>{{ episode['Time'] }}</td>
                        <td>{{ episode['Author'] }}</td>
                        <td><a href="{{ episode['Link'] }}">查看资源详情</a></td>
                    </tr>
                {% endfor %}
            </table>
        </div>
    {% endfor %}
    <h2>昨日所有新增资源</h2>
    <div class="card">
        <table>
            <tr>
                <th>Episode</th>
                <th>Time</th>
                <th>Author</th>
                <th>Link</th>
            </tr>
            {% for episode in all_episodes %}
                <tr>
                    <td>{{ episode['Episode'] }}</td>
                    <td>{{ episode['Time'] }}</td>
                    <td>{{ episode['Author'] }}</td>
                    <td><a href="{{ episode['Link'] }}">查看资源详情</a></td>
                </tr>
            {% endfor %}
        </table>
    </div>
</body>
</html>
